#ifndef __SSHD_CALLBACK_EVEN
#define __SSHD_CALLBACK_EVEN 1
#include<libssh/callbacks.h>
#include <log4cxx/logger.h>
#include <logger.hpp>
#include <config.hpp>
#include <callback_interface.hpp>

class CallbackEvent {
private:
    ssh_server_callbacks server_callbacks;
    ssh_channel_callbacks channel_callback;
    static CallbackInterface* interface;
public:
    CallbackEvent(void* udata);
    ~CallbackEvent();
    bool set_server_callback(ssh_session session);
    bool set_channel_callback(ssh_channel channel);
    // 服务端回调
    static int event_auth_password_function(ssh_session session, const char *user, const char *password, void *userdata);
    static ssh_channel event_channel_open_request_session_function(ssh_session session, void *userdata);
    static int event_auth_pubkey(ssh_session session, const char *user, struct ssh_key_struct *pubkey, char signature_state, void *userdata);
    // 客户端回调
    static int event_channel_data_callback(ssh_session session, ssh_channel channel, void *data, uint32_t len, int is_stderr, void *userdata);
    static int event_channel_exec_request_callback(ssh_session session, ssh_channel channel, const char *command, void *userdata);
    static int event_channel_pty_request_callback(ssh_session session, ssh_channel channel, const char *term, int width, 
                    int height, int pxwidth, int pwheight, void *userdata);
    static int event_channel_pty_window_change_callback(ssh_session session, ssh_channel channel, int width, int height,
                         int pxwidth, int pwheight, void *userdata);
    static int event_channel_subsystem_request_callback(ssh_session session,ssh_channel channel,const char *subsystem,void *userdata);
    static int event_channel_shell_request_callback(ssh_session session, ssh_channel channel, void *userdata);
};
#endif